//
//  ManageViewController.m
//  CoachsBook
//
//  Created by MaBookPro on 2022/8/8.
//

#import "ManageViewController.h"

#import "StudentView.h"
#import "TrainingView.h"
#import "TeachingView.h"
#import "TotalView.h"


#import "ManageTraineesViewController.h"
#import "VoiceBroadcastViewController.h"

@interface ManageViewController ()
{
    StudentView *_StudentView;
    TrainingView *_TrainingView;
    TeachingView *_TeachingView;
    TotalView *_TotalView;
}

@end

@implementation ManageViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    self.view.backgroundColor = [UIColor whiteColor];
    //隐藏头部view
    self.navigationController.navigationBar.hidden = YES;
    NavigationHeadView *navgationheadv = [[NavigationHeadView alloc]initWithFrame:CGRectMake(0, 0, APPwidth, SafeAreaTopHight)];
    navgationheadv.titlelabel.text = @"管理工具";
    navgationheadv.titlelabel.textColor = [UIColor blackColor];
    navgationheadv.backbtn.hidden = YES;
    [self.view addSubview:navgationheadv];
    
    
    _StudentView = [[StudentView alloc]initWithFrame:CGRectMake(0, SafeAreaTopHight, APPwidth, 120)];
    [_StudentView.myStudentBtn addTarget:self action:@selector(myStudentBtnClick) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:_StudentView];
    
    _TrainingView = [[TrainingView alloc]initWithFrame:CGRectMake(0, _StudentView.height+_StudentView.y, APPwidth, 120)];
    [self.view addSubview:_TrainingView];

    
    _TeachingView = [[TeachingView alloc]initWithFrame:CGRectMake(0, _TrainingView.height+_TrainingView.y, APPwidth, 120)];
    [_TeachingView.lightVoiceBtn addTarget:self action:@selector(lightVoiceBtnClick) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:_TeachingView];

    _TotalView = [[TotalView alloc]initWithFrame:CGRectMake(0, _TeachingView.height+_TeachingView.y, APPwidth, 120)];
    [self.view addSubview:_TotalView];
}



// 语音播报
-(void)lightVoiceBtnClick{
    VoiceBroadcastViewController *vc = [[VoiceBroadcastViewController alloc]init];
    [self.navigationController pushViewController:vc animated:YES];
    
}





//我的学员
-(void)myStudentBtnClick
{
    ManageTraineesViewController *vc = [[ManageTraineesViewController alloc]init];
    [self.navigationController pushViewController:vc animated:YES];
}
#pragma mark -视图即将出现
-(void)viewWillAppear:(BOOL)animated{
        
    ((TabbarController *)self.tabBarController).tabBarView.hidden = NO;
    
}
@end
